<template>
	<view class="wap">
		<navbar :parameter='parameter'></navbar>
		<view class="box">
			<view class="title">订单信息</view>
			<view class="line acea-row row-between-wrapper">
				<view class="tit"> 订单编号 </view>
				<view class="cont"> {{list.order_sn}} </view>
			</view>
			<view class="line acea-row row-between-wrapper">
				<view class="tit"> 订单状态 </view>
				<view class="cont" :class="list.status == 0?'orange':(list.status == 1?'blue':'grey')">
					{{list.status == 0?'待支付':(list.status == 1?'已支付':(list.status == 2?'待评价':(list.status == 3?'已完成':'已取消 ')))}}
				</view>
			</view>
			<view class="line acea-row row-between-wrapper">
				<view class="tit"> 下单时间 </view>
				<view class="cont"> {{list.createtime}} </view>
			</view>
			<view class="line acea-row row-between-wrapper">
				<view class="tit"> 套餐名称 </view>
				<view class="cont"> {{list.info.name}} </view>
			</view>
			<view class="line acea-row row-between-wrapper">
				<view class="tit"> 体检费用 </view>
				<view class="cont price"> ￥{{list.pay_price}} </view>
			</view>
		</view>
		<view class="box">
			<view class="title">用户信息</view>
			<view class="line acea-row row-between-wrapper">
				<view class="tit"> 姓名 </view>
				<view class="cont"> {{list.info.user_name}} </view>
			</view>
			<view class="line acea-row row-between-wrapper">
				<view class="tit"> 性别 </view>
				<view class="cont"> {{list.info.user_sex}}</view>
			</view>
			<view class="line acea-row row-between-wrapper">
				<view class="tit"> 联系方式 </view>
				<view class="cont"> {{list.info.user_mobile}} </view>
			</view>
			<view class="line acea-row row-between-wrapper">
				<view class="tit"> 身份证号 </view>
				<view class="cont"> {{list.info.user_idcard}} </view>
			</view>
			<view class="line acea-row row-between-wrapper">
				<view class="tit"> 年龄 </view>
				<view class="cont"> {{list.info.age}} </view>
			</view>
			<view class="line acea-row row-between-wrapper">
				<view class="tit"> 婚姻状态 </view>
				<view class="cont"> {{list.info.marriage}} </view>
			</view>
		</view>
		<u-loading-page :loading="isdown"></u-loading-page>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				parameter: {
					'navbar': '1',
					'return': '1',
					'title': '订单详情',
					'color': true,
					'class': 'on'
				},
				list: {},
				isdown: true
			};
		},
		onLoad(option) {
			var id = option.id
			this.orderInfo(id)
		},
		onShow() {

		},
		/**
		 * 用户点击右上角分享
		 */
		onShareAppMessage: function() {

		},
		onShareTimeline(res) { //分享到朋友圈

		},
		methods: {
			async orderInfo(id) {
				console.log(uni.getStorageSync('openid'))
				const res = await this.$myRequest({
					url: '/api/order/orderInfo',
					data: {
						openid: uni.getStorageSync('openid'),
						order_id: id
					}
				})
				console.log("订单详情", res.data.data);
				this.list = res.data.data;
				this.isdown = false;
			},
		}
	}
</script>

<style lang="scss" scoped>
	.wap {
		padding: 30rpx;
	}

	.box {
		width: 100%;
		border-radius: 20rpx;
		background-color: #fff;
		margin-bottom: 30rpx;
		padding: 30rpx;
	}

	.box .title {
		color: #000;
		font-size: 32rpx;
		font-weight: 700;
		margin-bottom: 40rpx;
	}

	.box .line {
		color: #666;
		margin-bottom: 40rpx;
		font-size: 28rpx;
	}

	.box .line .cont.orange {
		color: #FE8802;
	}

	.box .line .cont.blue {
		color: #347DFE;
	}

	.box .line .cont.price {
		color: #FF0000;
	}



	.btn-box {
		padding-top: 30rpx;
	}

	.btn-box .btn,
	.btn-box .btn-full {
		width: 100%;
		height: 80rpx;
		border-radius: 12rpx;
		line-height: 80rpx;
		text-align: center;
		margin-bottom: 30rpx;
	}

	.btn-box .btn {
		background-color: #D8D8D8;
		color: #000;
	}

	.btn-box .btn-full {
		background-color: #347DFE;
		color: #fff;
	}
</style>
